from sqlalchemy import Column,create_engine,Integer,String,Date,MetaData
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base

Base=declarative_base()
# metadata=MetaData()

class Books(Base):
	__tablename__='books'

	id=Column(Integer,primary_key=True)
	bookname=Column(String(64),nullable=False)
	author=Column(String(64),nullable=False)
	author_nationality=Column(String(64))
	translator=Column(String(64))
	press=Column(String(64))
	buyDate=Column(String(64))

engine=create_engine('mysql+pymysql://root:root@127.0.0.1:3306/family?charset=utf8')
metadata=MetaData(engine)

Base.metadata.create_all(engine)

DBSession=sessionmaker(bind=engine)



